/**
* AssetListParser-
* Parses the asset list to give the managers a list of things to load
*
* @date 2011-04-11
* @author Rachel J. Morris
*
* http://www.moosader.com/
* http://code.google.com/p/unicorn-princess/
* GNU GPL v3 license
*/

#ifndef _AssetListParser
#define _AssetListParser

#include <string>
#include <iostream>

#include "_Global.h"
#include "MooseArray.hpp"

class AssetListParser
{
    private:
        MooseArray<std::string> _graphicAssetList;
        std::string _graphicAssetPath;
    public:
        void GenerateLists()
        {
            std::ifstream infile( ASSET_LIST.c_str() );
            std::string filename;
            std::string path = "";
            std::string type = "";

            while ( infile >> filename )
            {
                if ( filename == "GRAPHICS" )
                {
                    infile >> _graphicAssetPath;
                    type = filename;
                }
                else if ( filename == "SOUNDS" )
                {
                    type = filename;
                }
                else if ( filename == "LEVELS" )
                {
                    type = filename;
                }
                else if ( filename == "FONTS" )
                {
                    type = filename;
                }
                else
                {
                    // Refactor
                    if ( type == "GRAPHICS" )   { _graphicAssetList.Push( filename ); }
//                    if ( type == "SOUNDS" )     { _soundAsetList.Push( filename ); }
//                    if ( type == "LEVELS" )     { _levelAssetList.Push( filename ); }
//                    if ( type == "FONTS" )      { _fontAssetList.Push( filename ); }
                }

            }
        }

        MooseArray<std::string>& GetGraphicAssetList()
        {
            return _graphicAssetList;
        }

        std::string& GetGraphicAssetPath()
        {
            return _graphicAssetPath;
        }
};

#endif
